package com.cinema.Bean;

import java.sql.Timestamp;

public class MovieSession implements java.io.Serializable{
	private String sessionId; // 场次id
	private String hallId; // 场厅id
	private String movieId; // 影片id
	private String time; // 放映时间
	private double price; // 票价
	
	
	private Timestamp date;
	
	
	public Timestamp getDate() {
		return date;
	}
	public void setDate(Timestamp date) {
		this.date = date;
	}
	public String getSessionId() {
		return sessionId;
	}
	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}
	public String getHallId() {
		return hallId;
	}
	public void setHallId(String hallId) {
		this.hallId = hallId;
	}
	public String getMovieId() {
		return movieId;
	}
	public void setMovieId(String movieId) {
		this.movieId = movieId;
	}
	public String getTime() {
		return time;
	}
	public void setTime(String time) {
		this.time = time;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	
	public boolean equals(Object obj) {
		if (obj == null)// 非空性
			return false;
		if (obj == this)
			return false;// 自反性
		if (obj instanceof MovieSession) {
			// 向下转型
			MovieSession u = (MovieSession) obj;
			// 利用数据库的规则，主键相等，即数据相等
			return u.sessionId.equals(this.sessionId);
		}
		return false;
	}
	
	
	@Override
	public String toString() {
		return "MovieSession [sessionId=" + sessionId + ", hallId=" + hallId + ", movieId=" + movieId + ", time=" + time
				+ ", price=" + price + ", date=" + date + "]";
	}
	public MovieSession(String sessionId, String hallId, String movieId, String time, double price) {
		super();
		this.sessionId = sessionId;
		this.hallId = hallId;
		this.movieId = movieId;
		this.time = time;
		this.price = price;
	}
	
	public MovieSession() {
		super();
	}
	
	public int hashCode() {
		return this.sessionId.hashCode();// 返回主键的hashCode
	}
}
